package com.cakin.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName: HelloController
 * @Description: 原生控制器的实现类
 * @Date: 2020/6/10
 * @Author: cakin
 */
public class HelloController implements Controller {
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mv = new ModelAndView();
        // 业务数据
        String result = "hello mvc";
        mv.addObject("msg", result);
        // 页面跳转
        mv.setViewName("test");
        return mv;
    }
}
